import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:wu_you/res/colors.dart';

class LoadingView extends StatelessWidget {
  final Color color;
  final String title;
  LoadingView({Key key,this.color = Colors.white,this.title = '加载中...'}):super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        height: 100,
        width: 100,
        decoration: BoxDecoration(
          color: color,
          borderRadius: BorderRadius.all(Radius.circular(8)),
        ),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            SizedBox.fromSize(
              size: const Size.square(50),
              child: const RefreshProgressIndicator(),
            ),
            Material(child: Text("${title}", style: TextStyle(fontSize: 12, color: AppColors.textHintColor)),color: color,),
          ],
        ),
      ),
    );
  }
}
